package net.mymilkedeek.ludum.tinythumb.model;

import org.newdawn.slick.util.Log;

/**
 * TODO: Write Documentation
 *
 * @author Michael Demey
 */
public class Party {
    
    private Member member1;
    private Member member2;
    
    public Party() {
    }

    public Party(Member member , Member member2 ) {
        this.member1 = member;
        this.member2 = member2;
    }


    public Member getMember(int choice) {
        if ( choice == 1 ) {
            return member1;
        } else {
            return member2;
        }
    }

    public void setMember1(Member member1) {
        this.member1 = member1;
    }

    public void setMember2(Member member2) {
        this.member2 = member2;
    }

    public Member getMember1() {
        return member1;
    }

    public Member getMember2() {
        return member2;
    }

    public void addXp() {
        Log.debug("called xp");
        member1.xptoNxt -= 10;
        member2.xptoNxt -= 10;

        if ( member1.xptoNxt <= 0) {
            member1.lvl++;
            member1.atk += member1.lvl;
            member1.def += member1.lvl;
            member1.hp += member1.lvl;
            member1.xptoNxt = 100 + ( 10 * member1.lvl);
        }

        if ( member2.xptoNxt <= 0) {
            member2.lvl++;
            member2.atk += member2.lvl;
            member2.def += member2.lvl;
            member2.hp += member2.lvl;
            member2.xptoNxt = 100 + ( 10 * member2.lvl);
        }
    }
}
